package com.toonan.system.service.impl;


import java.util.List;

import org.springframework.stereotype.Component;
import com.alibaba.dubbo.config.annotation.Service;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.toonan.base.matatype.Dto;
import com.toonan.core.vo.Query;
import com.toonan.system.mapper.DeptMapper;
import com.toonan.system.model.Dept;
import com.toonan.system.service.IDeptService;


/**
 * <p>
 * 组织机构 服务实现类
 * </p>
 *
 * @author 陈骑元
 * @since 2018-05-14
 */
@Component
@Service(version = "1.0.0", timeout = 60000,interfaceClass=IDeptService.class)
public class DeptServiceImpl extends ServiceImpl<DeptMapper, Dept> implements IDeptService{

	/**
	 * 根据Dto查询并返回数据持久化对象集合
	 * 
	 * @return List<Dept>
	 */
	public List<Dept> list(Dto pDto) {

		return baseMapper.list(pDto);
	};

	/**
	 * 根据Dto查询并返回分页数据持久化对象集合
	 * 
	 * @return Page<Dept>
	 */
	public Page<Dept> listPage(Dto pDto) {
		Query<Dept> query = new Query<Dept>(pDto);
		query.setRecords(baseMapper.listPage(query, pDto));
		return query;
	};

	/**
	 * 根据Dto模糊查询并返回数据持久化对象集合(字符型字段模糊匹配，其余字段精确匹配)
	 * 
	 * @return List<Dept>
	 */
	public List<Dept> like(Dto pDto) {

		return baseMapper.like(pDto);

	};

	/**
	 * 根据Dto模糊查询并返回分页数据持久化对象集合(字符型字段模糊匹配，其余字段精确匹配)
	 * 
	 * @return Page<Dept>
	 */
	public Page<Dept> likePage(Dto pDto) {
		Query<Dept> query = new Query<Dept>(pDto);
		query.setRecords(baseMapper.likePage(query, pDto));
		return query;
	}
   

	public String calc(Dto pDto) {
		// TODO Auto-generated method stub
		return baseMapper.calc(pDto);
	}

	
}
